﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace commonlib
{
    public enum TRANSACTION_STATES {INITIATED=1,TENTATIVELY_COMMITED,COMMITED,ABORTED}

    [Serializable]
    public class Transaction
    {

        public Transaction()
        {
            // TODO: Complete member initialization
        }

        public Transaction(string key, String value,long txId, ICollection<DataServer> dataServers)
        {
            this.dataServers = dataServers;
            this.key = key;
            this.value = value;
            this.txId = txId;
        }

        public long txId 
        { 
            get; 
            set; 
        }

        public String key
        {
            get;
            set;
        }  

        public String value 
        {   
            get; 
            set; 
        } 

        public ICollection<DataServer> dataServers 
        {  
            get; 
            set; 
        }

        public TRANSACTION_STATES state
        {  
            get ; 
            set;
        }

        public void beginTx(long txId)
        {
        }

        public void setTransactionState(TRANSACTION_STATES state)
        {
            this.state = state;
        }


    }
}
